<?php

declare(strict_types=1);

namespace app\model;

use think\Model;
use think\Model\concern\SoftDelete;

/**
 * @mixin \think\Model
 */
class Members extends Model
{
    //
    use SoftDelete;
    protected $deleteTime = 'delete_time';

    /**
     * 刷新用户最后一次登录/操作时间
     */
    public function refreshLast()
    {
        $this->last_login_time = time();
        $this->last_login_ip = request()->ip();
        $this->isAutoWriteTimestamp(false)->save();
    }
}
